package sctu.edu.java.year2016.team07.nieying.day20160605.chapter10_2;

import java.util.*;

/**
 * Created by Administrator on 2016/6/5 0005.
 */

/**
 * 分别向set和list集合中添加"A","a","c","C","a",5个元素，观察重复值"a",能否在list
 * 集合以及set集合中成功添加。
 */
public class Letter {
    public static void main(String[] args){
        String a="A",b="d",c="c",d="C",e="a",f="a";
        List<String> list=new LinkedList<>();
        list.add("A");
        list.add("a");
        list.add("c");
        list.add("C");
        list.add("a");
        System.out.println(list);
        Set<String> set=new HashSet<>();
        set.addAll(list);
        Iterator<String>it=set.iterator();
        while (it.hasNext()){
            System.out.println(it.next());
        }

    }
}
